#ifndef TCPTOVREP_H
#define TCPTOVREP_H

#include <QObject>
#include <QTcpSocket>

#include <QTimer>
#include <QMutex>


#define D_COMM_SIZEOF_PKG_LEN 4
#define D_COMM_SIZEOF_CMD_TYPE 4
#define D_COMM_SIZEOF_BUF_SIZE 4


struct S_CLIENT_DATA{
    int pkgLen;
    int cmdType;
    int vecSize;
    QVector<float> vecData;
};

class TcpToVrep : public QTcpSocket
{
    Q_OBJECT
public:
    explicit TcpToVrep(QTcpSocket *parent = 0);

    //signals:
    //public slots:
    //   void time_out_do();

public  :
    void connectToVrep();
    void  move_axies( QVector<float> val );
    QVector<float> get_axies_data();

public:
    // QTcpSocket* clientSocket;//连接客户端的套接字
    QByteArray bufFromServer;//此缓冲区点数据将发向模拟器
    QByteArray bufToServer;//此缓冲区点数据将发送给客户端
    //  int clientID;//此机连接模拟器获得的ID
    //  float simulationStep;//模拟步长（暂无用）
    //  int getDataCount;//客户端发送的数据

    //  QTimer timer;
    QString remoteIpAddress;
    //  QVector<float> getdata;
};

#endif // TCPTOVREP_H
